<!--

 
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/system/SysDepartment.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/system/system/SysDepartment.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'DepartmentId',
                footer: "Foots",
                cnName: '组织架构',
                name: 'system/SysDepartment',
                url: "/SysDepartment/",
                sortName: "CreateDate"
            });
            const editFormFields = ref({"DepartmentName":"","ActiveRollCount":"","DeptNumber":""});
            const editFormOptions = ref([[{"title":"组织名称","required":true,"field":"DepartmentName"}],
                              [{"title":"在职清册人数","required":true,"field":"ActiveRollCount","type":"number"}],
                              [{"title":"实际人数","field":"DeptNumber","type":"number"}]]);
            const searchFormFields = ref({"DepartmentName":""});
            const searchFormOptions = ref([[{"title":"组织名称","field":"DepartmentName","type":"like"}]]);
            const columns = ref([{field:'DepartmentId',title:'DepartmentId',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'DepartmentName',title:'组织名称',type:'string',link:true,width:180,require:true,align:'left',sort:true},
                       {field:'DepartmentCode',title:'组织编号',type:'string',width:90,hidden:true,align:'left'},
                       {field:'ParentId',title:'上级组织',type:'guid',bind:{ key:'组织机构',data:[]},width:110,hidden:true,align:'left'},
                       {field:'DepartmentType',title:'组织类型',type:'string',width:110,hidden:true,align:'left'},
                       {field:'Enable',title:'是否可用',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:100,hidden:true,align:'left'},
                       {field:'CreateID',title:'CreateID',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人',type:'string',width:90,hidden:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:145,hidden:true,align:'left',sort:true},
                       {field:'ModifyID',title:'ModifyID',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人',type:'string',width:90,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:140,hidden:true,align:'left',sort:true},
                       {field:'ActiveRollCount',title:'在职清册人数',type:'int',width:80,require:true,align:'left'},
                       {field:'status',title:'为0 未修改 1 已经修改',type:'int',width:80,hidden:true,align:'left'},
                       {field:'DeptNumber',title:'实际人数',type:'int',width:80,align:'left'},
                       {field:'Factory',title:'所属厂区',type:'int',bind:{ key:'所属厂区',data:[]},width:80,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
